home *** CD-ROM | disk | FTP | other *** search
/ Workplace Effectiveness:…ecision-Making Strategies / Workplace Effectiveness: Decision-Making Strategies.iso / pc / Files / View.dxr / 00017_Simple Pushbutton.ls < prev    next >
Encoding:
Text File  |  1998-12-16  |  1.6 KB  |  53 lines

  1. property upMember, downMember, button_active
  2.  
  3. on mouseDown me
  4.   set the member of sprite the spriteNum of me to member the downMember of me
  5.   set the button_active of me to 1
  6. end
  7.  
  8. on mouseUp me
  9.   set the member of sprite the spriteNum of me to member the upMember of me
  10.   set the button_active of me to 0
  11.   updateStage()
  12. end
  13.  
  14. on mouseEnter me
  15.   if the button_active of me then
  16.     set the member of sprite the spriteNum of me to member the downMember of me
  17.   end if
  18. end
  19.  
  20. on mouseLeave me
  21.   if the button_active of me then
  22.     set the member of sprite the spriteNum of me to member the upMember of me
  23.   end if
  24. end
  25.  
  26. on mouseUpOutSide me
  27.   set the button_active of me to 0
  28. end
  29.  
  30. on beginSprite me
  31.   set the upMember of me to the member of sprite the spriteNum of me
  32.   set the button_active of me to 0
  33. end
  34.  
  35. on endSprite me
  36. end
  37.  
  38. on getPropertyDescriptionList
  39.   if the currentSpriteNum = 0 then
  40.     set memdefault to 0
  41.   else
  42.     set memref to the member of sprite the currentSpriteNum
  43.     set castLibNum to the castLibNum of memref
  44.     set memdefault to member (the memberNum of member memref + 1) of castLib castLibNum
  45.   end if
  46.   set p_list to [#downMember: [#comment: "Down state member:", #format: #graphic, #default: memdefault]]
  47.   return p_list
  48. end
  49.  
  50. on getBehaviorDescription
  51.   return "Makes a sprite work as a pushbutton with down state and mouse tracking. The sprite's initial castmember represents the button's normal state." & RETURN & "PARAMETERS:" & RETURN & "‚Ä¢ Down member - Choose the cast member to display when the button is pressed. The default value is the cast member immedietly following the sprite's current cast member."
  52. end
  53.